package com.ycd.feigens;

import com.ycd.domain.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * User服务feign接口
 */
// fallbackFactory -这里跟OpenFeign开启Hystrix降级一样，还是可以使用fallback属性
@FeignClient(value = "user-server",fallbackFactory = UserFeignSentinelFuse.class) // 表示是feign接口
@RequestMapping("/user")
public interface UserFeignClient {

    @GetMapping("/getById/{id}")
    User getById(@PathVariable("id") Long id);

}